package com.qf.blog.commons.exception;

import com.qf.blog.enums.ExceptionEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author Zhendong Song
 * @date 2023/6/5
 * @description
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BusinessException extends RuntimeException {
    private Integer code;

    private String msg;

    public BusinessException(ExceptionEnum e){
        this.setCode(e.getCode());
        this.setMsg(e.getMsg());
    }
}
